package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import org.springframework.stereotype.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
/**
* <p>
    * ${table.comment!} 服务实现类
    * </p>
*
* @classname: ${table.serviceImplName}
* @author: ${author}
* @since: ${date}
* @description: ${table.comment!} 服务实现层
* @towork: none
* @version: 1.0.0
*/
@Service
public class ${table.serviceImplName} implements ${table.serviceName} {

/**
* ${table.comment!} 持久层
*/
@Autowired
${table.mapperName} ${table.mapperName?uncap_first};

/**
* ${table.comment!} 列表查询
*
* @param ${entity?uncap_first} ${table.comment!}实体类
* @return ${entity?uncap_first}集合
*/
@Override
public List<${entity}> selectList(${entity} ${entity?uncap_first}){
return ${table.mapperName?uncap_first}.selectList(${entity?uncap_first});
}

/**
* ${table.comment!} 根据id查询数据
*
* @param id 主键id
* @return ${entity} 指定id的${table.comment!}数据
*/
@Override
public ${entity} getById( Long id){
return ${table.mapperName?uncap_first}.getById(id);
}

/**
* ${table.comment!} 新增
*
* @param ${entity?uncap_first} ${table.comment!}实体类
* @return 受影响行数
*/
@Override
public int add(${entity} ${entity?uncap_first}){
return ${table.mapperName?uncap_first}.insert(${entity?uncap_first});
}

/**
* ${table.comment!} 更新
*
* @param ${entity?uncap_first} ${table.comment!}实体类
* @return 受影响行数
*/
@Override
public int update(${entity} ${entity?uncap_first}){
return ${table.mapperName?uncap_first}.update(${entity?uncap_first});
}

/**
* ${table.comment!} 根据id删除数据
*
* @param id 主键id
* @return 受影响行数
*/
@Override
public int delete( Long id){
return ${table.mapperName?uncap_first}.delete(id);
}
}